package cn.hbwe.Dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class pRegisterDTO {
    @NotBlank(message = "姓名不能为空")
    @Length(max = 20,message = "姓名长度不能超过20")
    private String patientName;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6,max=11,message = "密码太短啦")
    private String patientPassword;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$",message = "手机号格式不对")
    private String patientPhone;

    @NotBlank(message = "账号不能为空")
    @Length(max = 11, message = "账号长度不能超过11位")
    @Length(min = 6,message = "账号长度不能小于6位")
    @Pattern(regexp = "^[A-Za-z0-9]+$",message = "账号只能包含字母和数字")
    private String patientAccount;

    @NotBlank(message = "邮箱不能为空")
    @Length(max = 20, min = 12 ,message = "请输入正确的QQ邮箱")
    @Pattern(regexp="^[1-9][0-9]{4,10}@qq.com$",message="请输入正确的QQ邮箱")
    private String patientEmail;


//    @NotBlank(message = "身份证号不能为空")
//    @Pattern(regexp = "^[1][3][0][0-9]{15}$",message = "身份证号格式不对")
//    private String userNumber;

//    @NotBlank(message = "地址不能为空")
//    @Length(max = 100,message = "地址长度不能超过100")
//    private String userAddress;

    @Min(value = 0,message = "年龄不合法")
    @Max(value = 200,message = "年龄不合法")
    private int patientAge;

    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "^(男|女){1}$",message="请输入男或女")
    private String patientSex;

    private int patientId;
}
